{include file="top.html"}
<div id="content" class="container">
    {include file="nav.html"}
    <div class="pro-view">
        <div class="cate-bg"></div>
        <div class="cate">
            <ul class="ui-clr">
                <li><a href="{'/yunbuy'|url}"{if !$smarty.get.cid} class="on"{/if}><i class="ap-icon d0"></i>全部{$L.unit_yun}</a></li>
                {foreach from=$yuncat item=m name=list}
                <li><a{if $smarty.get.cid eq $m.id} class="on"{/if} href="{'/yunbuy/index?cid='|cat:$m.id|url}{if $smarty.get.zq}&zq={$smarty.get.zq}{/if}"><i class="ap-icon d{$smarty.foreach.list.index+1}"></i>{$m.catname}</a></li>
                {/foreach}
            </ul>
        </div>
        <ul class="paiList"></ul>
    </div>
    <div class="loading getMore"></div>

</div>
{include file="footer.html"}
<script src="/style/mobile/js/jquery-pageload.js"></script>
<script type="text/javascript">
    var order = "{if $smarty.get.order}{$smarty.get.order}{else}count{/if}";
    var sort = "{if $smarty.get.sort}{$smarty.get.sort}{else}ASC{/if}";
    var url = "/yunbuy/index";
    var param = "cid={$cid}&order="+order+"&sort="+sort+"&type=2&zq={$smarty.get.zq}";

    $(function(){
        $('.sort li.li_sort').removeClass('on DESC ASC');
        $('.sort #li_'+order).addClass('on '+sort);
        $('.paiList').pageload({ url: url, param: param });

        $('#li_cate').bind('click',function(){
            if($(this).hasClass('DESC')){
                $(this).removeClass('DESC').addClass('ASC');
            }else{
                $(this).removeClass('ASC').addClass('DESC');
            }
            $('.cate-bg,.cate').toggle();
        })
    });

    function mLoad(type){
        if(type=='need_num'){ sort=(sort=='ASC')?'DESC':'ASC'; }
        else if(type=='end_num'){ sort='ASC'; }
        else{ sort='DESC'; }
        location.replace(url+(url.indexOf('?')>-1?'&':'?')+'cid={$cid}&order='+type+'&sort='+sort+"&type={$type}&zq={$smarty.get.zq}");
    }
</script>
